<%-- 
    Document   : giohang
    Created on : 25-10-2011, 14:00:22
    Author     : VuTienIT
--%>
<%@page import="java.util.ArrayList" %>
<%@page import="model.pojo.*" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!-- Lấy giỏ hàng -->
<%   
ArrayList<PhieuPOJO> gioHang = null;
if(session.getAttribute("GioHang")==null)
{
    gioHang = new ArrayList<PhieuPOJO>();
    session.setAttribute("GioHang", gioHang);
}
else
{
    gioHang = (ArrayList<PhieuPOJO>)session.getAttribute("GioHang");
}
%>
<!-- Tạo session đăng nhập -->
<%
KhachHangPOJO ssDangNhap = null;
if(session.getAttribute("KhachHangPOJO")==null)
{
    ssDangNhap = new KhachHangPOJO();
    session.setAttribute("KhachHangPOJO", ssDangNhap);
}
else
{
    ssDangNhap = (KhachHangPOJO)session.getAttribute("KhachHangPOJO");
}
%>
<!DOCTYPE html>
<div id="content_middle">
<div class="detail_box">
<div class="sidebar_box_content">
<form action="GioHang?Page=Engage" method="post" name="form-giohang" id="form-giohang">
<table width="100%" border="0.5">
<tr>
<td align="center"><h4>Xoá</h4></td>
<td align="center"><h4>Tên sản phẩm</h4></td>
<td align="center"><h4>Số lượng</h4></td>
<td align="center"><h4>Đơn giá</h4></td>
<td align="center"><h4>Thành Tiền</h4></td>
</tr>
<%
double s = 0;
for(int i=0;i<gioHang.size();i++)
{
    PhieuPOJO ph = gioHang.get(i);
%>
<tr>
  <td align='center'><label>
    <input type='checkbox' name='cbXoa' id='cbXoa' value='<%=ph.getMaPhieu()%>' />
  </label></td>
  <td align='center'><%=ph.getTenPhieu()%></td>
  <td align='center'><label>
    <input name='tbsoluong' type='text' id='tbsoluong' size="8" value='<%=ph.getSoLuongQuyDinh()%>' />
  </label></td>
  <td align='center'><%=ph.getGiaBan()%></td>
  <td align='center'><%=ph.getThanhTienGioHang()%></td>
</tr>
<%
    s = s + ph.getThanhTienGioHang();
}
%>
<tr>
<td colspan="3" align="left"><label>
&nbsp&nbsp&nbsp <input type="submit" name="btXoa" id="btXoa" value="Xoá" />
</label></td>
<td align="center"><font color="#FF0000"><b>Tổng tiền</b></font></td>
<td align="center"><span class="style1"><%=s%> VNĐ</span></td>
</tr>
</table>

<br />

<table width="100%" border="0">
<tr align="center">
<td width="25%">
<label>
<a href="home?Page=View">
<input type="button" name="btnMuaTiep" id="btnMuaTiep" value="Tiếp tục mua" />
</a>
</label>
</td>
<td width="25%"><label>
<input type="submit" name="btnXoaTatCa" id="btnXoaTatCa" value="Xoá tất cả" />
</label></td>
<td width="25%"><label>
<input type="submit" name="btnCapNhat" id="btnCapNhat" value="Cập nhật" />
</label></td>
<td width="25%"><label>
<input type="submit" name="btnLuuGioHang" id="btnLuuGioHang" value="Lưu giỏ hàng" />
</label></td>
</tr>
</table>
</form>
</div>
<p>&nbsp;</p>
</div>

<div class="cleaner"></div>
</div>